//
//  WCImageTableHeaderCell.m
//  WabbitCode
//
//  Created by William Towe on 11/22/08.
//  Copyright 2008 Revolution Software. All rights reserved.
//

#import "WCImageTableHeaderCell.h"


@implementation WCImageTableHeaderCell
- (id)initImageCell:(NSImage *)image {
	if (!(self = [super initImageCell:image]))
		return nil;
	
	[self setAlignment:NSCenterTextAlignment];
	[[self image] setSize:NSMakeSize([self imageWidth], [self imageHeight])];
	
	return self;
}

- (void)drawInteriorWithFrame:(NSRect)frame inView:(NSView *)view {
	if ([self image]) {
		[[self image] compositeToPoint:NSMakePoint(frame.origin.x+floor((frame.size.width-[self imageWidth])/2), frame.origin.y+floor((frame.size.height+[self imageHeight])/2)) operation:NSCompositeSourceOver];
	}	
}

- (NSRect)sortIndicatorRectForBounds:(NSRect)theRect {
	return NSZeroRect;
}

@dynamic imageWidth;
- (CGFloat)imageWidth {
	return 10.0;
}
@dynamic imageHeight;
- (CGFloat)imageHeight {
	return 10.0;
}
@end
